package Day13_StringBuilder类;

//String转换为StringBuilder,通过    有参构造方法

//StringBuilder转换为String,通过    String s = sb.toString();

public class 转换 {
    public static void main(String[] args) {
        //1.
        //String转换为StringBuilder
        //通过StringBuilder构造方法
        //StringBuilder(String s)创建一个指定内容的StringBuilder
        StringBuilder sb = new StringBuilder("hello");
        System.out.println(sb);

        //2.
        //StringBuilder转换为String
        //String s = sb.toString() 将StringBuilder的内容转成字符串
        sb.append(true);

        String s = sb.toString();
        System.out.println(s);
    }
}
